// 主组件,页面入口文件,所有页面都是在App.vue下进行切换,负责构建定义及页面组件归集
<template>
  <div id="app">
    <el-container>
      <el-aside :width="isCollapse ? '70px' : '201px'">
        <div class="kaiguan">
          <el-switch
            v-model="isCollapseSwitch"
            inactive-color="#13ce66"
          >
          </el-switch>
        </div>
        <el-menu
          default-active="1-4-1"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          :collapse="isCollapse"
          :collapse-transition="false"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span slot="title">导航一</span>
            </template>
            <el-menu-item-group>
              <span slot="title">分组一</span>
              <el-menu-item index="1-1">选项1</el-menu-item>
              <el-menu-item index="1-2">选项2</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="分组2">
              <el-menu-item index="1-3">选项3</el-menu-item>
            </el-menu-item-group>
            <el-submenu index="1-4">
              <span slot="title">选项4</span>
              <el-menu-item index="1-4-1">选项1</el-menu-item>
            </el-submenu>
          </el-submenu>
          <el-menu-item index="2">
            <i class="el-icon-menu"></i>
            <span slot="title">导航二</span>
          </el-menu-item>
          <el-menu-item index="3" disabled>
            <i class="el-icon-document"></i>
            <span slot="title">导航三</span>
          </el-menu-item>
          <el-menu-item index="4">
            <i class="el-icon-setting"></i>
            <span slot="title">导航四</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <div class="mianbaoxie">
          <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item><a href="/">活动管理</a></el-breadcrumb-item>
            <el-breadcrumb-item>活动列表</el-breadcrumb-item>
            <el-breadcrumb-item>活动详情</el-breadcrumb-item>
          </el-breadcrumb>
        </div>
        <video class="shipin" controls width="500">
          <source
            src="./picAndVideo/lll.mp4"
            type="video/mp4"
          />
          Sorry, your browser doesn't support embedded videos.
        </video>
        <object
          class="pdfkk"
          data="http://127.0.0.1:5501//暗黑风格-图解网络-小林coding-v2.0.pdf"
          type="application/pdf"
        ></object>
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'app',
  data () {
    return {
      // 是否折叠
      isCollapse: true,
      isCollapseSwitch: false
    }
  },
  methods: {
    handleOpen (key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose (key, keyPath) {
      console.log(key, keyPath)
    }
  },
  watch: {
    isCollapseSwitch (newValue, oldValue) {
      this.isCollapse = !this.isCollapse
    }
  }
}
</script>

<style>
html,
body {
  margin: 0px;
  height: 100%;
}

#app {
  height: 100%;
}

.el-container {
  height: 100%;
}

.el-aside {
  /* background-color: #d3dce6; */
  height: 100%;
}

.kaiguan {
  padding: 5px;
  padding-left: 10px;
}

.el-main {
  background-color: #e9eef3;
  padding: 5px;
  height: 100%;
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
}

.mianbaoxie {
  background-color: white;
  padding: 10px;
}

.shipin {
  display: block;
  margin-left: auto;
  margin-right: auto;
  padding: 2%;
  width: 50%;
}

.pdfkk {
  display: block;
  margin-right: auto;
  margin-left: auto;
  width: 100%;
  height: 100%;
}
</style>
